<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Simple Counter</title>
	</head>
	<body>
		<h2>使用 Prop 传递数据</h2>
		<div id="example-4">
			<input v-model="parentMsg"/>
			<br />
			<child v-bind:my-message="parentMsg"></child>
		</div>
		<script type="text/javascript" src="js/vue.js" ></script>
		<script type="text/javascript">
			// 注册
			Vue.component('child', {
				props: ['myMessage'],
				template: '<span>{{ myMessage }}</span>'
			});
			
			new Vue({
				el: '#example-4',
				data: {
					parentMsg: 'Hello Vue.js!'
				}
			});
			
		</script>
	</body>
</html>
